import sys
from PySide6.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget
from PySide6.QtCharts import QtCharts

class Oscilloscope(QMainWindow):
    def __init__(self):
        super().__init__()
        self.init_ui()

    def init_ui(self):
        self.setWindowTitle("ESP32 Oscilloscope")
        self.resize(800, 600)

        layout = QVBoxLayout()
        container = QWidget()

        self.chart = QtCharts.QChart()
        self.chart.setTitle("Waveform")

        self.chart_view = QtCharts.QChartView(self.chart)
        self.chart_view.setRenderHint(QtCharts.Qt.Antialiasing)

        layout.addWidget(self.chart_view)

        container.setLayout(layout)
        self.setCentralWidget(container)

if __name__ == "__main__":
    app = QApplication(sys.argv)
    oscilloscope = Oscilloscope()
    oscilloscope.show()
    sys.exit(app.exec())